home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JInternalFrame.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  14.9 KB  |  837 lines

  1. package javax.swing;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Cursor;
  7. import java.awt.FocusTraversalPolicy;
  8. import java.awt.Graphics;
  9. import java.awt.KeyboardFocusManager;
  10. import java.awt.LayoutManager;
  11. import java.awt.Rectangle;
  12. import java.awt.Window;
  13. import java.beans.PropertyVetoException;
  14. import java.io.IOException;
  15. import java.io.ObjectOutputStream;
  16. import javax.accessibility.Accessible;
  17. import javax.accessibility.AccessibleContext;
  18. import javax.swing.event.InternalFrameEvent;
  19. import javax.swing.event.InternalFrameListener;
  20. import javax.swing.plaf.InternalFrameUI;
  21. import sun.awt.AppContext;
  22. import sun.awt.SunToolkit;
  23. import sun.swing.SwingUtilities2;
  24.  
  25. public class JInternalFrame extends JComponent implements Accessible, WindowConstants, RootPaneContainer {
  26.    private static final String uiClassID = "InternalFrameUI";
  27.    protected JRootPane rootPane;
  28.    protected boolean rootPaneCheckingEnabled;
  29.    protected boolean closable;
  30.    protected boolean isClosed;
  31.    protected boolean maximizable;
  32.    protected boolean isMaximum;
  33.    protected boolean iconable;
  34.    protected boolean isIcon;
  35.    protected boolean resizable;
  36.    protected boolean isSelected;
  37.    protected Icon frameIcon;
  38.    protected String title;
  39.    protected JDesktopIcon desktopIcon;
  40.    private Cursor lastCursor;
  41.    private boolean opened;
  42.    private Rectangle normalBounds;
  43.    private int defaultCloseOperation;
  44.    private Component lastFocusOwner;
  45.    public static final String CONTENT_PANE_PROPERTY = "contentPane";
  46.    public static final String MENU_BAR_PROPERTY = "JMenuBar";
  47.    public static final String TITLE_PROPERTY = "title";
  48.    public static final String LAYERED_PANE_PROPERTY = "layeredPane";
  49.    public static final String ROOT_PANE_PROPERTY = "rootPane";
  50.    public static final String GLASS_PANE_PROPERTY = "glassPane";
  51.    public static final String FRAME_ICON_PROPERTY = "frameIcon";
  52.    public static final String IS_SELECTED_PROPERTY = "selected";
  53.    public static final String IS_CLOSED_PROPERTY = "closed";
  54.    public static final String IS_MAXIMUM_PROPERTY = "maximum";
  55.    public static final String IS_ICON_PROPERTY = "icon";
  56.    private static final Object PROPERTY_CHANGE_LISTENER_KEY = new StringBuilder("InternalFramePropertyChangeListener");
  57.    boolean isDragging;
  58.    boolean danger;
  59.  
  60.    private static void addPropertyChangeListenerIfNecessary() {
  61.       if (AppContext.getAppContext().get(PROPERTY_CHANGE_LISTENER_KEY) == null) {
  62.          FocusPropertyChangeListener var0 = new FocusPropertyChangeListener((1)null);
  63.          AppContext.getAppContext().put(PROPERTY_CHANGE_LISTENER_KEY, var0);
  64.          KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(var0);
  65.       }
  66.  
  67.    }
  68.  
  69.    private static void updateLastFocusOwner(Component var0) {
  70.       if (var0 != null) {
  71.          for(Object var1 = var0; var1 != null && !(var1 instanceof Window); var1 = ((Component)var1).getParent()) {
  72.             if (var1 instanceof JInternalFrame) {
  73.                ((JInternalFrame)var1).setLastFocusOwner(var0);
  74.             }
  75.          }
  76.       }
  77.  
  78.    }
  79.  
  80.    public JInternalFrame() {
  81.       this("", false, false, false, false);
  82.    }
  83.  
  84.    public JInternalFrame(String var1) {
  85.       this(var1, false, false, false, false);
  86.    }
  87.  
  88.    public JInternalFrame(String var1, boolean var2) {
  89.       this(var1, var2, false, false, false);
  90.    }
  91.  
  92.    public JInternalFrame(String var1, boolean var2, boolean var3) {
  93.       this(var1, var2, var3, false, false);
  94.    }
  95.  
  96.    public JInternalFrame(String var1, boolean var2, boolean var3, boolean var4) {
  97.       this(var1, var2, var3, var4, false);
  98.    }
  99.  
  100.    public JInternalFrame(String var1, boolean var2, boolean var3, boolean var4, boolean var5) {
  101.       this.rootPaneCheckingEnabled = false;
  102.       this.normalBounds = null;
  103.       this.defaultCloseOperation = 2;
  104.       this.isDragging = false;
  105.       this.danger = false;
  106.       this.setRootPane(this.createRootPane());
  107.       this.setLayout(new BorderLayout());
  108.       this.title = var1;
  109.       this.resizable = var2;
  110.       this.closable = var3;
  111.       this.maximizable = var4;
  112.       this.isMaximum = false;
  113.       this.iconable = var5;
  114.       this.isIcon = false;
  115.       this.setVisible(false);
  116.       this.setRootPaneCheckingEnabled(true);
  117.       this.desktopIcon = new JDesktopIcon(this);
  118.       this.updateUI();
  119.       SunToolkit.checkAndSetPolicy(this, true);
  120.       addPropertyChangeListenerIfNecessary();
  121.    }
  122.  
  123.    protected JRootPane createRootPane() {
  124.       return new JRootPane();
  125.    }
  126.  
  127.    public InternalFrameUI getUI() {
  128.       return (InternalFrameUI)this.ui;
  129.    }
  130.  
  131.    public void setUI(InternalFrameUI var1) {
  132.       boolean var2 = this.isRootPaneCheckingEnabled();
  133.  
  134.       try {
  135.          this.setRootPaneCheckingEnabled(false);
  136.          super.setUI(var1);
  137.       } finally {
  138.          this.setRootPaneCheckingEnabled(var2);
  139.       }
  140.  
  141.    }
  142.  
  143.    public void updateUI() {
  144.       this.setUI((InternalFrameUI)UIManager.getUI(this));
  145.       this.invalidate();
  146.       if (this.desktopIcon != null) {
  147.          this.desktopIcon.updateUIWhenHidden();
  148.       }
  149.  
  150.    }
  151.  
  152.    void updateUIWhenHidden() {
  153.       this.setUI((InternalFrameUI)UIManager.getUI(this));
  154.       this.invalidate();
  155.       Component[] var1 = this.getComponents();
  156.       if (var1 != null) {
  157.          for(int var2 = 0; var2 < var1.length; ++var2) {
  158.             SwingUtilities.updateComponentTreeUI(var1[var2]);
  159.          }
  160.       }
  161.  
  162.    }
  163.  
  164.    public String getUIClassID() {
  165.       return "InternalFrameUI";
  166.    }
  167.  
  168.    protected boolean isRootPaneCheckingEnabled() {
  169.       return this.rootPaneCheckingEnabled;
  170.    }
  171.  
  172.    protected void setRootPaneCheckingEnabled(boolean var1) {
  173.       this.rootPaneCheckingEnabled = var1;
  174.    }
  175.  
  176.    protected void addImpl(Component var1, Object var2, int var3) {
  177.       if (this.isRootPaneCheckingEnabled()) {
  178.          this.getContentPane().add(var1, var2, var3);
  179.       } else {
  180.          super.addImpl(var1, var2, var3);
  181.       }
  182.  
  183.    }
  184.  
  185.    public void remove(Component var1) {
  186.       int var2 = this.getComponentCount();
  187.       super.remove(var1);
  188.       if (var2 == this.getComponentCount()) {
  189.          this.getContentPane().remove(var1);
  190.       }
  191.  
  192.    }
  193.  
  194.    public void setLayout(LayoutManager var1) {
  195.       if (this.isRootPaneCheckingEnabled()) {
  196.          this.getContentPane().setLayout(var1);
  197.       } else {
  198.          super.setLayout(var1);
  199.       }
  200.  
  201.    }
  202.  
  203.    /** @deprecated */
  204.    @Deprecated
  205.    public JMenuBar getMenuBar() {
  206.       return this.getRootPane().getMenuBar();
  207.    }
  208.  
  209.    public JMenuBar getJMenuBar() {
  210.       return this.getRootPane().getJMenuBar();
  211.    }
  212.  
  213.    /** @deprecated */
  214.    @Deprecated
  215.    public void setMenuBar(JMenuBar var1) {
  216.       JMenuBar var2 = this.getMenuBar();
  217.       this.getRootPane().setJMenuBar(var1);
  218.       this.firePropertyChange("JMenuBar", var2, var1);
  219.    }
  220.  
  221.    public void setJMenuBar(JMenuBar var1) {
  222.       JMenuBar var2 = this.getMenuBar();
  223.       this.getRootPane().setJMenuBar(var1);
  224.       this.firePropertyChange("JMenuBar", var2, var1);
  225.    }
  226.  
  227.    public Container getContentPane() {
  228.       return this.getRootPane().getContentPane();
  229.    }
  230.  
  231.    public void setContentPane(Container var1) {
  232.       Container var2 = this.getContentPane();
  233.       this.getRootPane().setContentPane(var1);
  234.       this.firePropertyChange("contentPane", var2, var1);
  235.    }
  236.  
  237.    public JLayeredPane getLayeredPane() {
  238.       return this.getRootPane().getLayeredPane();
  239.    }
  240.  
  241.    public void setLayeredPane(JLayeredPane var1) {
  242.       JLayeredPane var2 = this.getLayeredPane();
  243.       this.getRootPane().setLayeredPane(var1);
  244.       this.firePropertyChange("layeredPane", var2, var1);
  245.    }
  246.  
  247.    public Component getGlassPane() {
  248.       return this.getRootPane().getGlassPane();
  249.    }
  250.  
  251.    public void setGlassPane(Component var1) {
  252.       Component var2 = this.getGlassPane();
  253.       this.getRootPane().setGlassPane(var1);
  254.       this.firePropertyChange("glassPane", var2, var1);
  255.    }
  256.  
  257.    public JRootPane getRootPane() {
  258.       return this.rootPane;
  259.    }
  260.  
  261.    protected void setRootPane(JRootPane var1) {
  262.       if (this.rootPane != null) {
  263.          this.remove(this.rootPane);
  264.       }
  265.  
  266.       JRootPane var2 = this.getRootPane();
  267.       this.rootPane = var1;
  268.       if (this.rootPane != null) {
  269.          boolean var3 = this.isRootPaneCheckingEnabled();
  270.  
  271.          try {
  272.             this.setRootPaneCheckingEnabled(false);
  273.             this.add(this.rootPane, "Center");
  274.          } finally {
  275.             this.setRootPaneCheckingEnabled(var3);
  276.          }
  277.       }
  278.  
  279.       this.firePropertyChange("rootPane", var2, var1);
  280.    }
  281.  
  282.    public void setClosable(boolean var1) {
  283.       Boolean var2 = this.closable ? Boolean.TRUE : Boolean.FALSE;
  284.       Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  285.       this.closable = var1;
  286.       this.firePropertyChange("closable", var2, var3);
  287.    }
  288.  
  289.    public boolean isClosable() {
  290.       return this.closable;
  291.    }
  292.  
  293.    public boolean isClosed() {
  294.       return this.isClosed;
  295.    }
  296.  
  297.    public void setClosed(boolean var1) throws PropertyVetoException {
  298.       if (this.isClosed != var1) {
  299.          Boolean var2 = this.isClosed ? Boolean.TRUE : Boolean.FALSE;
  300.          Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  301.          if (var1) {
  302.             this.fireInternalFrameEvent(25550);
  303.          }
  304.  
  305.          this.fireVetoableChange("closed", var2, var3);
  306.          this.isClosed = var1;
  307.          if (this.isClosed) {
  308.             this.setVisible(false);
  309.          }
  310.  
  311.          this.firePropertyChange("closed", var2, var3);
  312.          if (this.isClosed) {
  313.             this.dispose();
  314.          } else if (!this.opened) {
  315.          }
  316.  
  317.       }
  318.    }
  319.  
  320.    public void setResizable(boolean var1) {
  321.       Boolean var2 = this.resizable ? Boolean.TRUE : Boolean.FALSE;
  322.       Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  323.       this.resizable = var1;
  324.       this.firePropertyChange("resizable", var2, var3);
  325.    }
  326.  
  327.    public boolean isResizable() {
  328.       return this.isMaximum ? false : this.resizable;
  329.    }
  330.  
  331.    public void setIconifiable(boolean var1) {
  332.       Boolean var2 = this.iconable ? Boolean.TRUE : Boolean.FALSE;
  333.       Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  334.       this.iconable = var1;
  335.       this.firePropertyChange("iconable", var2, var3);
  336.    }
  337.  
  338.    public boolean isIconifiable() {
  339.       return this.iconable;
  340.    }
  341.  
  342.    public boolean isIcon() {
  343.       return this.isIcon;
  344.    }
  345.  
  346.    public void setIcon(boolean var1) throws PropertyVetoException {
  347.       if (this.isIcon != var1) {
  348.          this.firePropertyChange("ancestor", (Object)null, this.getParent());
  349.          Boolean var2 = this.isIcon ? Boolean.TRUE : Boolean.FALSE;
  350.          Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  351.          this.fireVetoableChange("icon", var2, var3);
  352.          this.isIcon = var1;
  353.          this.firePropertyChange("icon", var2, var3);
  354.          if (var1) {
  355.             this.fireInternalFrameEvent(25552);
  356.          } else {
  357.             this.fireInternalFrameEvent(25553);
  358.          }
  359.  
  360.       }
  361.    }
  362.  
  363.    public void setMaximizable(boolean var1) {
  364.       Boolean var2 = this.maximizable ? Boolean.TRUE : Boolean.FALSE;
  365.       Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  366.       this.maximizable = var1;
  367.       this.firePropertyChange("maximizable", var2, var3);
  368.    }
  369.  
  370.    public boolean isMaximizable() {
  371.       return this.maximizable;
  372.    }
  373.  
  374.    public boolean isMaximum() {
  375.       return this.isMaximum;
  376.    }
  377.  
  378.    public void setMaximum(boolean var1) throws PropertyVetoException {
  379.       if (this.isMaximum != var1) {
  380.          Boolean var2 = this.isMaximum ? Boolean.TRUE : Boolean.FALSE;
  381.          Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  382.          this.fireVetoableChange("maximum", var2, var3);
  383.          this.isMaximum = var1;
  384.          this.firePropertyChange("maximum", var2, var3);
  385.       }
  386.    }
  387.  
  388.    public String getTitle() {
  389.       return this.title;
  390.    }
  391.  
  392.    public void setTitle(String var1) {
  393.       String var2 = this.title;
  394.       this.title = var1;
  395.       this.firePropertyChange("title", var2, var1);
  396.    }
  397.  
  398.    public void setSelected(boolean var1) throws PropertyVetoException {
  399.       if (var1 && this.isSelected) {
  400.          this.restoreSubcomponentFocus();
  401.       } else if (this.isSelected != var1) {
  402.          if (var1) {
  403.             if (this.isIcon) {
  404.                if (!this.desktopIcon.isShowing()) {
  405.                   return;
  406.                }
  407.             } else if (!this.isShowing()) {
  408.                return;
  409.             }
  410.          }
  411.  
  412.          Boolean var2 = this.isSelected ? Boolean.TRUE : Boolean.FALSE;
  413.          Boolean var3 = var1 ? Boolean.TRUE : Boolean.FALSE;
  414.          this.fireVetoableChange("selected", var2, var3);
  415.          if (var1) {
  416.             this.restoreSubcomponentFocus();
  417.          }
  418.  
  419.          this.isSelected = var1;
  420.          this.firePropertyChange("selected", var2, var3);
  421.          if (this.isSelected) {
  422.             this.fireInternalFrameEvent(25554);
  423.          } else {
  424.             this.fireInternalFrameEvent(25555);
  425.          }
  426.  
  427.          this.repaint();
  428.       }
  429.    }
  430.  
  431.    public boolean isSelected() {
  432.       return this.isSelected;
  433.    }
  434.  
  435.    public void setFrameIcon(Icon var1) {
  436.       Icon var2 = this.frameIcon;
  437.       this.frameIcon = var1;
  438.       this.firePropertyChange("frameIcon", var2, var1);
  439.    }
  440.  
  441.    public Icon getFrameIcon() {
  442.       return this.frameIcon;
  443.    }
  444.  
  445.    public void moveToFront() {
  446.       if (this.isIcon()) {
  447.          if (this.getDesktopIcon().getParent() instanceof JLayeredPane) {
  448.             ((JLayeredPane)this.getDesktopIcon().getParent()).moveToFront(this.getDesktopIcon());
  449.          }
  450.       } else if (this.getParent() instanceof JLayeredPane) {
  451.          ((JLayeredPane)this.getParent()).moveToFront(this);
  452.       }
  453.  
  454.    }
  455.  
  456.    public void moveToBack() {
  457.       if (this.isIcon()) {
  458.          if (this.getDesktopIcon().getParent() instanceof JLayeredPane) {
  459.             ((JLayeredPane)this.getDesktopIcon().getParent()).moveToBack(this.getDesktopIcon());
  460.          }
  461.       } else if (this.getParent() instanceof JLayeredPane) {
  462.          ((JLayeredPane)this.getParent()).moveToBack(this);
  463.       }
  464.  
  465.    }
  466.  
  467.    public Cursor getLastCursor() {
  468.       return this.lastCursor;
  469.    }
  470.  
  471.    public void setCursor(Cursor var1) {
  472.       if (var1 == null) {
  473.          this.lastCursor = null;
  474.          super.setCursor(var1);
  475.       } else {
  476.          int var2 = var1.getType();
  477.          if (var2 != 4 && var2 != 5 && var2 != 6 && var2 != 7 && var2 != 8 && var2 != 9 && var2 != 10 && var2 != 11) {
  478.             this.lastCursor = var1;
  479.          }
  480.  
  481.          super.setCursor(var1);
  482.       }
  483.    }
  484.  
  485.    public void setLayer(Integer var1) {
  486.       if (this.getParent() != null && this.getParent() instanceof JLayeredPane) {
  487.          JLayeredPane var2 = (JLayeredPane)this.getParent();
  488.          var2.setLayer(this, var1, var2.getPosition(this));
  489.       } else {
  490.          JLayeredPane.putLayer(this, var1);
  491.          if (this.getParent() != null) {
  492.             this.getParent().repaint(this.getX(), this.getY(), this.getWidth(), this.getHeight());
  493.          }
  494.       }
  495.  
  496.    }
  497.  
  498.    public void setLayer(int var1) {
  499.       this.setLayer(new Integer(var1));
  500.    }
  501.  
  502.    public int getLayer() {
  503.       return JLayeredPane.getLayer(this);
  504.    }
  505.  
  506.    public JDesktopPane getDesktopPane() {
  507.       Container var1;
  508.       for(var1 = this.getParent(); var1 != null && !(var1 instanceof JDesktopPane); var1 = var1.getParent()) {
  509.       }
  510.  
  511.       if (var1 == null) {
  512.          for(var1 = this.getDesktopIcon().getParent(); var1 != null && !(var1 instanceof JDesktopPane); var1 = var1.getParent()) {
  513.          }
  514.       }
  515.  
  516.       return (JDesktopPane)var1;
  517.    }
  518.  
  519.    public void setDesktopIcon(JDesktopIcon var1) {
  520.       JDesktopIcon var2 = this.getDesktopIcon();
  521.       this.desktopIcon = var1;
  522.       this.firePropertyChange("desktopIcon", var2, var1);
  523.    }
  524.  
  525.    public JDesktopIcon getDesktopIcon() {
  526.       return this.desktopIcon;
  527.    }
  528.  
  529.    public Rectangle getNormalBounds() {
  530.       return this.normalBounds != null ? this.normalBounds : this.getBounds();
  531.    }
  532.  
  533.    public void setNormalBounds(Rectangle var1) {
  534.       this.normalBounds = var1;
  535.    }
  536.  
  537.    public Component getFocusOwner() {
  538.       return this.isSelected() ? this.lastFocusOwner : null;
  539.    }
  540.  
  541.    public Component getMostRecentFocusOwner() {
  542.       if (this.isSelected()) {
  543.          return this.getFocusOwner();
  544.       } else if (this.lastFocusOwner != null) {
  545.          return this.lastFocusOwner;
  546.       } else {
  547.          FocusTraversalPolicy var1 = this.getFocusTraversalPolicy();
  548.          if (var1 instanceof InternalFrameFocusTraversalPolicy) {
  549.             return ((InternalFrameFocusTraversalPolicy)var1).getInitialComponent(this);
  550.          } else {
  551.             Component var2 = var1.getDefaultComponent(this);
  552.             return (Component)(var2 != null ? var2 : this.getContentPane());
  553.          }
  554.       }
  555.    }
  556.  
  557.    public void restoreSubcomponentFocus() {
  558.       if (this.isIcon()) {
  559.          SwingUtilities2.compositeRequestFocus(this.getDesktopIcon());
  560.       } else {
  561.          this.lastFocusOwner = this.getMostRecentFocusOwner();
  562.          if (this.lastFocusOwner == null) {
  563.             this.lastFocusOwner = this.getContentPane();
  564.          }
  565.  
  566.          this.lastFocusOwner.requestFocus();
  567.       }
  568.  
  569.    }
  570.  
  571.    private void setLastFocusOwner(Component var1) {
  572.       this.lastFocusOwner = var1;
  573.    }
  574.  
  575.    public void reshape(int var1, int var2, int var3, int var4) {
  576.       super.reshape(var1, var2, var3, var4);
  577.       this.validate();
  578.       this.repaint();
  579.    }
  580.  
  581.    public void addInternalFrameListener(InternalFrameListener var1) {
  582.       this.listenerList.add(InternalFrameListener.class, var1);
  583.       this.enableEvents(0L);
  584.    }
  585.  
  586.    public void removeInternalFrameListener(InternalFrameListener var1) {
  587.       this.listenerList.remove(InternalFrameListener.class, var1);
  588.    }
  589.  
  590.    public InternalFrameListener[] getInternalFrameListeners() {
  591.       return (InternalFrameListener[])this.listenerList.getListeners(InternalFrameListener.class);
  592.    }
  593.  
  594.    protected void fireInternalFrameEvent(int var1) {
  595.       Object[] var2 = this.listenerList.getListenerList();
  596.       InternalFrameEvent var3 = null;
  597.  
  598.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  599.          if (var2[var4] == InternalFrameListener.class) {
  600.             if (var3 == null) {
  601.                var3 = new InternalFrameEvent(this, var1);
  602.             }
  603.  
  604.             switch (var3.getID()) {
  605.                case 25549:
  606.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameOpened(var3);
  607.                   break;
  608.                case 25550:
  609.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameClosing(var3);
  610.                   break;
  611.                case 25551:
  612.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameClosed(var3);
  613.                   break;
  614.                case 25552:
  615.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameIconified(var3);
  616.                   break;
  617.                case 25553:
  618.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameDeiconified(var3);
  619.                   break;
  620.                case 25554:
  621.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameActivated(var3);
  622.                   break;
  623.                case 25555:
  624.                   ((InternalFrameListener)var2[var4 + 1]).internalFrameDeactivated(var3);
  625.             }
  626.          }
  627.       }
  628.  
  629.    }
  630.  
  631.    public void doDefaultCloseAction() {
  632.       this.fireInternalFrameEvent(25550);
  633.       switch (this.defaultCloseOperation) {
  634.          case 0:
  635.          default:
  636.             break;
  637.          case 1:
  638.             this.setVisible(false);
  639.             if (this.isSelected()) {
  640.                try {
  641.                   this.setSelected(false);
  642.                } catch (PropertyVetoException var3) {
  643.                }
  644.             }
  645.             break;
  646.          case 2:
  647.             try {
  648.                this.fireVetoableChange("closed", Boolean.FALSE, Boolean.TRUE);
  649.                this.isClosed = true;
  650.                this.setVisible(false);
  651.                this.firePropertyChange("closed", Boolean.FALSE, Boolean.TRUE);
  652.                this.dispose();
  653.             } catch (PropertyVetoException var2) {
  654.             }
  655.       }
  656.  
  657.    }
  658.  
  659.    public void setDefaultCloseOperation(int var1) {
  660.       this.defaultCloseOperation = var1;
  661.    }
  662.  
  663.    public int getDefaultCloseOperation() {
  664.       return this.defaultCloseOperation;
  665.    }
  666.  
  667.    public void pack() {
  668.       try {
  669.          if (this.isIcon()) {
  670.             this.setIcon(false);
  671.          } else if (this.isMaximum()) {
  672.             this.setMaximum(false);
  673.          }
  674.       } catch (PropertyVetoException var2) {
  675.          return;
  676.       }
  677.  
  678.       this.setSize(this.getPreferredSize());
  679.       this.validate();
  680.    }
  681.  
  682.    public void show() {
  683.       if (!this.isVisible()) {
  684.          if (!this.opened) {
  685.             this.fireInternalFrameEvent(25549);
  686.             this.opened = true;
  687.          }
  688.  
  689.          this.getDesktopIcon().setVisible(true);
  690.          this.toFront();
  691.          super.show();
  692.          if (!this.isIcon) {
  693.             if (!this.isSelected()) {
  694.                try {
  695.                   this.setSelected(true);
  696.                } catch (PropertyVetoException var2) {
  697.                }
  698.             }
  699.  
  700.          }
  701.       }
  702.    }
  703.  
  704.    public void hide() {
  705.       if (this.isIcon()) {
  706.          this.getDesktopIcon().setVisible(false);
  707.       }
  708.  
  709.       super.hide();
  710.    }
  711.  
  712.    public void dispose() {
  713.       if (this.isVisible()) {
  714.          this.setVisible(false);
  715.       }
  716.  
  717.       if (this.isSelected()) {
  718.          try {
  719.             this.setSelected(false);
  720.          } catch (PropertyVetoException var2) {
  721.          }
  722.       }
  723.  
  724.       if (!this.isClosed) {
  725.          this.firePropertyChange("closed", Boolean.FALSE, Boolean.TRUE);
  726.          this.isClosed = true;
  727.       }
  728.  
  729.       this.fireInternalFrameEvent(25551);
  730.    }
  731.  
  732.    public void toFront() {
  733.       this.moveToFront();
  734.    }
  735.  
  736.    public void toBack() {
  737.       this.moveToBack();
  738.    }
  739.  
  740.    public final void setFocusCycleRoot(boolean var1) {
  741.    }
  742.  
  743.    public final boolean isFocusCycleRoot() {
  744.       return true;
  745.    }
  746.  
  747.    public final Container getFocusCycleRootAncestor() {
  748.       return null;
  749.    }
  750.  
  751.    public final String getWarningString() {
  752.       return null;
  753.    }
  754.  
  755.    private void writeObject(ObjectOutputStream var1) throws IOException {
  756.       var1.defaultWriteObject();
  757.       if (this.getUIClassID().equals("InternalFrameUI")) {
  758.          byte var2 = JComponent.getWriteObjCounter(this);
  759.          --var2;
  760.          JComponent.setWriteObjCounter(this, var2);
  761.          if (var2 == 0 && this.ui != null) {
  762.             boolean var3 = this.isRootPaneCheckingEnabled();
  763.  
  764.             try {
  765.                this.setRootPaneCheckingEnabled(false);
  766.                this.ui.installUI(this);
  767.             } finally {
  768.                this.setRootPaneCheckingEnabled(var3);
  769.             }
  770.          }
  771.       }
  772.  
  773.    }
  774.  
  775.    void compWriteObjectNotify() {
  776.       boolean var1 = this.isRootPaneCheckingEnabled();
  777.  
  778.       try {
  779.          this.setRootPaneCheckingEnabled(false);
  780.          super.compWriteObjectNotify();
  781.       } finally {
  782.          this.setRootPaneCheckingEnabled(var1);
  783.       }
  784.  
  785.    }
  786.  
  787.    protected String paramString() {
  788.       String var1 = this.rootPane != null ? this.rootPane.toString() : "";
  789.       String var2 = this.rootPaneCheckingEnabled ? "true" : "false";
  790.       String var3 = this.closable ? "true" : "false";
  791.       String var4 = this.isClosed ? "true" : "false";
  792.       String var5 = this.maximizable ? "true" : "false";
  793.       String var6 = this.isMaximum ? "true" : "false";
  794.       String var7 = this.iconable ? "true" : "false";
  795.       String var8 = this.isIcon ? "true" : "false";
  796.       String var9 = this.resizable ? "true" : "false";
  797.       String var10 = this.isSelected ? "true" : "false";
  798.       String var11 = this.frameIcon != null ? this.frameIcon.toString() : "";
  799.       String var12 = this.title != null ? this.title : "";
  800.       String var13 = this.desktopIcon != null ? this.desktopIcon.toString() : "";
  801.       String var14 = this.opened ? "true" : "false";
  802.       String var15;
  803.       if (this.defaultCloseOperation == 1) {
  804.          var15 = "HIDE_ON_CLOSE";
  805.       } else if (this.defaultCloseOperation == 2) {
  806.          var15 = "DISPOSE_ON_CLOSE";
  807.       } else if (this.defaultCloseOperation == 0) {
  808.          var15 = "DO_NOTHING_ON_CLOSE";
  809.       } else {
  810.          var15 = "";
  811.       }
  812.  
  813.       return super.paramString() + ",closable=" + var3 + ",defaultCloseOperation=" + var15 + ",desktopIcon=" + var13 + ",frameIcon=" + var11 + ",iconable=" + var7 + ",isClosed=" + var4 + ",isIcon=" + var8 + ",isMaximum=" + var6 + ",isSelected=" + var10 + ",maximizable=" + var5 + ",opened=" + var14 + ",resizable=" + var9 + ",rootPane=" + var1 + ",rootPaneCheckingEnabled=" + var2 + ",title=" + var12;
  814.    }
  815.  
  816.    protected void paintComponent(Graphics var1) {
  817.       if (this.isDragging) {
  818.          this.danger = true;
  819.       }
  820.  
  821.       super.paintComponent(var1);
  822.    }
  823.  
  824.    public AccessibleContext getAccessibleContext() {
  825.       if (this.accessibleContext == null) {
  826.          this.accessibleContext = new AccessibleJInternalFrame(this);
  827.       }
  828.  
  829.       return this.accessibleContext;
  830.    }
  831.  
  832.    // $FF: synthetic method
  833.    static void access$100(Component var0) {
  834.       updateLastFocusOwner(var0);
  835.    }
  836. }
  837.